package com.example.demo.niuke;

/**
 * @Description:
 * @Author: LLL
 * @Date: 2020-03-21 16:14
 **/

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Description:
 * @Author: LLL
 * @Date: 2020-03-21 15:18
 **/
public class Main17 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = null;
        while ((line = br.readLine()) != null) {
            int i = Integer.parseInt(line);
            if (i == 0) {
                break;
            }
            System.out.println(getN(i));

        }

    }

    public static int getN(int n) {
        //        return 1;
        //        // 至少可以喝的数量
        //        int j = n / 3;
        //        int k = n % 3;
        //        while (j==3){
        //            return j+(k+j)
        //        }
        int result = 0;
        int total = n;
        while (total > 0) {//不断循环
            if (total == 2) {//只剩下两瓶就+1
                total++;
            }
            total = total - 3;
            if (total >= 0) {//每减三瓶总数加一瓶，结果也加一
                total++;
                result++;
            }
        }
        return result;
    }

}

